package com.ldc.commonlibs.http

import com.ldc.commonlibs.common.RspModel
import com.ldc.commonlibs.model.LoginModel
import com.ldc.commonlibs.model.UserInfoModel
import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.*

interface HttpServer {

    @FormUrlEncoded
    @POST(value = "user/login")
    suspend fun login(@FieldMap map: HashMap<String, @JvmSuppressWildcards Any>): Response<ResponseBody>


    @GET(value = "user/lg/userinfo/json")
    suspend fun userInfo(): RspModel<UserInfoModel>

    // 收藏站内
    @POST(value = "lg/collect/{id}/json")
    suspend fun collect(@Path("id") id: String): RspModel<Any>

    // 取消收藏（文章列表）
    @POST(value = "lg/uncollect_originId/{id}/json")
    suspend fun uncollect_originId(@Path(value = "id") originId: String = "-1"): RspModel<Any>    // 取消收藏

    //取消收藏（我的收藏）
    @FormUrlEncoded
    @POST(value = "lg/uncollect/{id}/json")
    suspend fun uncollect(
        @Path(value = "id") id: String = "-1",
        @Field(value = "originId") originId: String
    ): RspModel<Any>

}